package com.cssw.fyzb.core.dao.word;

import com.cssw.fyzb.core.model.dodb.WordCommand;
import org.springframework.stereotype.Repository;

/**
 * @Author: yangyiqun
 * @Date: 2020/10/10 15:10
 */
@Repository
public class WordCommandDaoImpl implements WordCommandDao {

    @Override
    public WordCommand findById(Long commandId) {
        return WordCommand.dao.findById(commandId);
    }

    @Override
    public Long save(Long userId, Long sourceId, String type, String param) {
        WordCommand wordCommand = new WordCommand();
        wordCommand.setUserId(userId);
        wordCommand.setType(type);
        wordCommand.setParam(param);
        wordCommand.setSourceId(sourceId);
        wordCommand.save();
        return wordCommand.getCommandId();
    }
}
